FROM codercom/code-server:3.6.2
RUN sudo sed -i s/deb.debian.org/mirrors.cloud.tencent.com/g /etc/apt/sources.list
RUN sudo apt-get update
RUN sudo apt-get install -y  htop iftop git ansible unzip make autoconf wget curl
RUN sudo apt-get install -y gcc g++ cmake python-pip python python3 python3-dev python-dev


WORKDIR /home/coder/.pip/
ADD ./files/pip.conf .

WORKDIR /home/coder/soft
ADD https://mirrors.cloud.tencent.com/nodejs-release/v14.4.0/node-v14.4.0-linux-x64.tar.xz  .
ADD https://dl.google.com/go/go1.13.14.linux-amd64.tar.gz .
ADD https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/8/jdk/x64/linux/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz .
ADD https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip .

RUN sudo tar -xvf ./node-v14.4.0-linux-x64.tar.xz
RUN sudo tar -xvf ./go1.13.14.linux-amd64.tar.gz
RUN sudo tar -xvf ./OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz
RUN sudo unzip ./apache-maven-3.6.3-bin.zip 

RUN sudo rm -Rf node-v14.4.0-linux-x64.tar.xz
RUN sudo rm -Rf go1.13.14.linux-amd64.tar.gz
RUN sudo rm -Rf OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz
RUN sudo rm -Rf apache-maven-3.6.3-bin.zip 

RUN sudo chmod -Rf 777 ./*

ENV NODE_HOME /home/coder/soft/node-v14.4.0-linux-x64/bin
ENV GOPATH /home/coder/gopath
ENV GOROOT /home/coder/soft/go
ENV GOCACHE /tmp
ENV JAVA_HOME /home/coder/soft/jdk8u275-b01
ENV MAVEN_HOME /home/coder/soft/apache-maven-3.6.3
ENV PATH $PATH:/home/coder/soft/node-v14.4.0-linux-x64/bin:/home/coder/soft/go/bin:/home/coder/soft/jdk8u275-b01/bin:/home/coder/soft/apache-maven-3.6.3/bin


ADD ./files/script.sh /tmp
RUN sh /tmp/script.sh


WORKDIR /home/coder
